package Box2D.Dynamics.Controllers
{
	import Box2D.Common.b2Wrapper;
	import Box2D.Dynamics.b2Body;
	import Box2D.Dynamics.b2TimeStep;
	import Box2D.Dynamics.b2World;
	
	import mx.core.mx_internal;
	
	//32 bytes
	public class b2Controller extends b2Wrapper
	{
		mx_internal var _world:b2World;
		public function b2Controller()
		{
			super();
		}
		public function AddBody(body:b2Body):void{
			call('b2Controller_AddBody',body.wrapper);
		}
		public function RemoveBody(body:b2Body):void{
			call('b2Controller_RemoveBody',body.wrapper);
		}
		public function Clear():void{
			call('b2Controller_Clear')
		}
		public function GetType():int{
			return call('b2Controller_GetType');
		}
		public function GetNext():b2Controller{
			return call('b2Controller_GetNext');
		}
		public function GetBodyList():b2ControllerEdge{
			var p:int = call('b2Controller_GetBodyList'); 
			if(p!=0)
				return new b2ControllerEdge(p);
			else
				return null;
		}
		public function GetWorld():b2World{return mx_internal::_world}	
		public function cStep(stepPtr:Object):void{
			Step(new b2TimeStep(stepPtr));
		}
		public virtual function Step(step:b2TimeStep):void{
			
		}
		public virtual function onRemoveBody(body:b2Body):void{
			
		}
		public virtual function onAddBody(body:b2Body):void{
			
		}
	}
}